									
package com.module.systemConfig.service;

import java.util.HashMap;
import java.util.Map;

import base.util.Page;

import com.module.systemConfig.manager.SystemConfigManager;
import com.module.systemConfig.vo.SystemConfig;

public class SystemConfigService {

	public Page list(SystemConfig bean, Integer start, Integer limit)
			throws Exception {
		Page page = new Page();
		page.setStart(start);
		page.setLimit(limit);
		//bean.setUserId(LoginSession.getUserid());
		SystemConfigManager manager = SystemConfigManager.getInstance();
		page = manager.list(page, bean);
		return page;
	}

	public Map<String,Object> remove(Long id)throws Exception{       
		Map<String,Object> map = new HashMap<String,Object>();
		SystemConfigManager manager = SystemConfigManager.getInstance();
		map = manager.delete(id);
		return map;
		
	}


	public Map<String,Object> save(SystemConfig bean)throws Exception{
		//bean.setOrgId(LoginSession.getOrgid());
		Map<String,Object> map = new HashMap<String,Object>();
		SystemConfigManager manager = SystemConfigManager.getInstance();
		map = manager.add(bean);
		return map;

	} 
	

	public SystemConfig findById(Long id)throws Exception{
		SystemConfig bean = new SystemConfig();
		SystemConfigManager manager = SystemConfigManager.getInstance();
		bean = manager.findById(id);
		return bean;
	}
	
	
	public SystemConfig queryByKey(String configKey)throws Exception{
		SystemConfig bean = new SystemConfig();
		SystemConfigManager manager = SystemConfigManager.getInstance();
		bean = manager.queryByKey(configKey);
		return bean;
	}
	

}
